<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let s1=new Set(["tom","rose","mark"]);
        let arr=[...s1];
        let s2=new Set([NaN,NaN,undefined,undefined,null,null,{},{}]);
        console.log(s2.size);

        console.log("--1、遍历集合--");
        for(let u of s1){
            console.log(u);
        }
        console.log("--2、获取所有key键--");
        for(let k of s1.keys()){
            console.log(k);
        }
        console.log("--3、获取所有value值--");
        for(let v of s1.values()){
            console.log(v);
        }

        console.log("--4、获取所有key-value键值对--");
        for(let obj of s1.entries()){
            console.log(obj);
        }

        console.log("--5、forEach遍历--");
        s1.forEach(v=>console.log(v));

        console.log("--6、forEach带参数遍历--");
        s1.forEach(function(v){console.log(this+v);},"用户：");
        
        console.log(arr);
    </script>
</body>
</html>